/*
 * @Author: shijianxin
 * @Date: 2022-04-24 16:55:49
 * @Description: 添加列表页
 */

import React from "react";
import MovieForm from "../../components/MovieForm";
import { IMovie, MovieService } from "../../services/MovieService";

export default class extends React.Component {
  render() {
    return (
      <MovieForm
        onSubmit={async (movie: IMovie) => {
          const resp = await MovieService.add(movie);
          if (resp.data) {
            return null;
          } else {
            return resp.err;
          }
        }}
      />
    );
  }
}
